<template>
  <div class="project-list" style="margin: 15px;">
    <el-card style="width:100%">
      <!-- 标题头 -->
      <div slot="header" style="padding-bottom: 10px;">
        <span style="display: flex; align-items: center; font-size: 18px">
          <img
            src="@/assets/img/xmlb.png"
            style="height: 20px; width: 20px; margin-right: 5px"
          />
          项目列表</span
        >
      </div>
      <!-- 项目内容 -->
      <div
        style="min-height: 680px; padding-top: 20px"
        v-loading="loading"
        element-loading-text="加载中..."
        element-loading-spinner="el-icon-loading"
        element-loading-background="rgba(0,0,0,0.2)"
      >
        <!-- 查询 -->
        <div v-show="userName != '用户'">
          <el-form :inline="true" label-position="left" label-width="80px">
            <el-form-item label="项目名称">
              <el-input
                placeholder="请输入项目名称"
                v-model="queryParams.roleName"
                clearable
                style="width: 200px"
              ></el-input>
            </el-form-item>
            <el-form-item
              label="状态"
              label-width="55px"
              style="margin-left: 30px"
            >
              <el-select
                clearable
                v-model="queryParams.status"
                placeholder="请选择状态"
                style="width: 200px"
              >
                <el-option
                  v-for="dict in statusOptions"
                  :label="dict.dictLabel"
                  :value="dict.dictValue"
                  :key="dict.dictValue"
                  style="width: 200px"
                ></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="创建时间" style="margin-left: 30px">
              <el-date-picker
                v-model="queryParams.dateRange"
                style="width: 200px"
                type="daterange"
                value-format="yyyy-MM-dd"
                range-separator="至"
                start-placeholder="开始日期"
                :picker-options="pickerOptions0"
                end-placeholder="结束日期"
              >
              </el-date-picker>
            </el-form-item>
            <span style="text-align: center; margin-left: 100px">
              <el-button
                icon="el-icon-refresh"
                style="background: #eeeeee; color: #6396f4; font-weight: bold"
                @click="resetQuery"
                >重置
              </el-button>
              <el-button type="primary" icon="el-icon-search" @click="getList"
                >搜索</el-button
              >
            </span>
          </el-form>
        </div>
        <!-- <div class="xhxBox"></div> -->
        <el-divider v-if="userName != '用户'"></el-divider>
        <!-- 项目列表 -->
        <div class="content" style="height: 75%">
          <!-- 按钮 -->
          <div style="display: flex; justify-content: space-between">
            <el-button
              type="primary"
              icon="el-icon-plus"
              @click="editBotton"
              v-if="userName != '用户'"
              >新增项目</el-button
            >
            <!-- <el-button
              type="primary"
              icon="el-icon-plus"
              @click="handleAdd"
              v-if="userName != '用户'"
              >新增项目</el-button
            > -->
            <!-- <el-button style="background: #EEEEEE;color: #6396F4;font-weight: bold">
              <img src="./img/daochu.svg" style="width: 15px;height: 15px;margin-right: 5px;margin-bottom: -2px"/>导出
            </el-button> -->
          </div>
          <!-- 卡片式列表 -->
          <el-empty
            :image-size="200"
            description="暂无数据"
            v-show="roleList.length <= 0"
          ></el-empty>
          <div
            v-show="roleList.length > 0"
            style="
              margin-top: 10px;
              padding-bottom: 20px;
              display: flex;
              flex-direction: column;
              justify-content: space-between;
            "
          >
            <!-- 租户的项目列表 -->
            <div
              style="display: flex; flex-wrap: wrap; margin-left: -26px"
              v-if="userName != '用户'"
            >
              <el-card
                shadow="always"
                :style="{
                  height: 250 + 'px',
                  width: 380 + 'px',
                  'margin-bottom': 15 + 'px',
                  'border-radius': 10 + 'px',
                  background: item.state == 1 ? '#FFFFFF' : '#f5f5f5',
                  'margin-left': 26 + 'px',
                }"
                v-for="(item, index) in roleList"
                :key="index"
              >
                <!-- 状态栏 -->
                <div style="" class="topBoxCard">
                  <div class="LeftBox">
                    <div class="imgBox">
                      <img
                        v-show="item.state"
                        src="@/assets/img/qiyong.svg"
                        style="height: 15px; margin-right: 5px"
                        @click="EnableforbiddenButton(item)"
                      />
                      <span v-show="item.state">启用</span>

                      <img
                        v-show="!item.state"
                        @click="EnableforbiddenButton(item)"
                        src="@/assets/img/tingyong.svg"
                        style="height: 15px; margin-right: 5px"
                      />
                      <span
                        v-show="!item.state"
                        style="color: rgb(176, 176, 176)"
                        >禁用</span
                      >
                    </div>
                  </div>

                  <div class="rightBox">
                    <div style="margin-right: 15px">
                      <img
                        src="@/assets/img/edit.svg"
                        style="width: 12px; height: 12px; margin-right: 5px"
                      />
                      <el-button type="text" @click="editBotton(item)"
                        >修改</el-button
                      >
                    </div>

                    <div
                      v-if="item.ugName != '默认用户组'"
                      style="display: flex; align-items: center"
                    >
                      <img
                        src="@/assets/img/delete.svg"
                        style="width: 15px; height: 15px; margin-right: 5px"
                      />
                      <el-button type="text" @click="delData(item)"
                        >删除</el-button
                      >
                    </div>
                  </div>
                </div>
                <!-- 项目内容 -->
                <div
                  style="
                    height: 90px;
                    display: flex;
                    justify-content: space-between;
                    align-items: center;
                    margin-top: 0px;
                    border-bottom: 1px solid #eee;
                  "
                >
                  <!-- 左部基础信息 -->
                  <div style="display: flex">
                    <!-- 图标 -->
                    <div
                      style="
                        height: 55px;
                        width: 55px;
                        border-radius: 50%;
                        background: #fff7f2;
                        display: flex;
                        justify-content: center;
                        align-items: center;
                      "
                    >
                      <!-- <img :src="require(''+item.icon)" style="width: 20px;height: 20px;"> -->
                      <img
                        :src="item.proLogo"
                        style="width: 25px; height: 25px; border-radius: 5px"
                      />
                    </div>
                    <!-- 名称+类型 -->
                    <div style="margin-left: 10px">
                      <div
                        style="
                          font-size: 16px;
                          margin-bottom: 8px;
                          font-weight: bold;
                          margin-left: 5px;
                        "
                      >
                        {{ item.proName }}
                      </div>
                      <div
                        :style="{
                          'border-radius': 10 + 'px',
                          width: 60 + 'px',
                          height: 20 + 'px',
                          color: 'white',
                          'font-size': 9 + 'px',
                          'text-align': 'center',
                          'line-height': 20 + 'px',
                          background: item.typeId == 2 ? '#FAB244' : '#538AFF',
                        }"
                      >
                        {{ item.four }}
                      </div>
                    </div>
                  </div>
                  <!-- 右部排序信息 -->
                  <div
                    style="
                      color: #88888e;
                      font-size: 12px;
                      text-align: right;
                      font-weight: 400;
                    "
                  >
                    <!--  -->

                    <!--  -->
                    <div style="margin-bottom: 8px">
                      排序:<span style="color: #7095f7; margin-left: 5px">{{
                        item.proSort
                      }}</span>
                    </div>
                    <!-- <div>{{ item.five }}</div> -->
                    <div @click="dataBotton(item)" style="cursor: pointer">
                      <el-button type="text" style="margin-right: 5px"
                        >数据展示
                      </el-button>
                      <img
                        src="@/assets/img/yjt.png"
                        alt=""
                        style="width: 15px"
                      />
                    </div>
                  </div>
                </div>
                <!-- 操作按钮 -->
                <div class="project-button">
                  <div class="topBox">
                    <!-- <div>
                    <img
                      src="@/assets/img/edit.svg"
                      style="width: 12px; height: 12px"
                    />
                    <el-button type="text" @click="editBotton(item)"
                      >修改</el-button
                    >
                  </div> -->

                    <div class="buttonBox">
                      <img
                        src="@/assets/img/scsj.png"
                        style="width: 15px; height: 15px"
                      />
                      <el-button type="text" @click="IdentificationBotton(item)"
                        >上传数据</el-button
                      >
                    </div>
                    <div class="buttonBox">
                      <img
                        src="@/assets/img/jlpz.png"
                        style="width: 15px; height: 15px"
                      />
                      <el-button type="text" @click="awardTemplate(item)"
                        >奖励模板</el-button
                      >
                    </div>
                    <!-- <div>
                    <img src="./img/yongjin.svg" style="width: 13px;height: 13px"/>
                    佣金模板</div> -->
                    <div class="buttonBox" v-if="item.ugName != '默认用户组'">
                      <img
                        src="@/assets/img/jiesuanshezhi.svg"
                        style="width: 15px; height: 15px"
                      /><el-button
                        type="text"
                        @click="settlementSetupButton(item)"
                        >结算设置</el-button
                      >
                    </div>
                    <div class="buttonBox">
                      <img
                        src="@/assets/img/jiesuan.svg"
                        style="width: 13px; height: 13px"
                      /><el-button type="text" @click="settlementBotton(item)"
                        >结算</el-button
                      >
                    </div>
                  </div>

                  <div class="topBox">
                    <div
                      class="buttonBox"
                      v-show="item3.isHide == '0'"
                      v-for="(item3, index) in item.cTime"
                      :key="index"
                    >
                      <img :src="item3.url" style="width: 15px; height: 15px" />
                      <el-button
                        type="text"
                        @click="jurisdiction(item3, item)"
                        >{{ item3.configName }}</el-button
                      >
                    </div>
                    <!-- <el-dropdown trigger="click" placement="bottom">
                      <div
                        style="
                          color: #3874f6;
                          font-size: 13px;
                          cursor: pointer;
                          margin-top: 8px;
                          font-size: 14px;
                        "
                      >
                        更多<i class="el-icon-arrow-down el-icon--right"></i>
                      </div>
                      <el-dropdown-menu
                        slot="dropdown"
                        v-if="item.cTime.length > 0"
                      >
                        <el-dropdown-item
                          v-show="item3.isHide == '0'"
                          v-for="(item3, index) in item.cTime"
                          :key="index"
                          style="padding: 0px; width: 80px"
                        >
                          <el-button
                            type="text"
                            class="moreButton"
                            style="width: 100%"
                            @click="jurisdiction(item3, item)"
                          >
                            {{ item3.configName }}
                          </el-button>
                        </el-dropdown-item>
                      </el-dropdown-menu>
                    </el-dropdown> -->
                  </div>
                </div>
              </el-card>
            </div>
            <!-- 用户的项目列表 -->
            <div
              style="display: flex; flex-wrap: wrap; margin-left: -26px"
              v-else
            >
              <el-card
                shadow="always"
                :style="{
                  height: 'auto',
                  width: 380 + 'px',
                  'margin-bottom': 15 + 'px',
                  'border-radius': 10 + 'px',
                  background: item.state == 1 ? '#FFFFFF' : '#f5f5f5',
                  'margin-left': 26 + 'px',
                  cursor: 'pointer',
                }"
                v-for="(item, index) in roleList"
                :key="index"
              >
                <!-- 状态栏 -->

                <!-- 项目内容 -->
                <div
                  @click="dataBotton(item)"
                  style="
                    height: 90px;
                    border-bottom: 1px solid #ededed;
                    display: flex;
                    justify-content: space-between;
                    align-items: center;
                  "
                >
                  <!-- 左部基础信息 -->
                  <div style="display: flex">
                    <!-- 图标 -->
                    <div
                      style="
                        height: 55px;
                        width: 55px;
                        border-radius: 50%;
                        background: #fff7f2;
                        display: flex;
                        justify-content: center;
                        align-items: center;
                      "
                    >
                      <img
                        :src="item.proLogo"
                        style="width: 25px; height: 25px; border-radius: 5px"
                      />
                    </div>
                    <!-- 名称+类型 -->
                    <div style="margin-left: 10px">
                      <div
                        style="
                          font-size: 16px;
                          margin-bottom: 8px;
                          font-weight: bold;
                          margin-left: 5px;
                        "
                      >
                        {{ item.proName }}
                      </div>
                    </div>
                  </div>
                  <!-- 右部排序信息 -->
                  <div @click="dataBotton(item)" style="cursor: pointer">
                    <el-button type="text" style="margin-right: 5px"
                      >数据展示
                    </el-button>
                    <img
                      src="@/assets/img/yjt.png"
                      alt=""
                      style="width: 15px"
                    />
                  </div>
                </div>
                <!-- 操作按钮 -->
                <div class="messageBox" @click="dataBotton(item)">
                  <div>
                    <span>备注：</span>
                    <span>{{ item.one }}</span>
                  </div>
                </div>
              </el-card>
            </div>
            <!-- 分页器 -->
            <pagination
              style="margin: 0px 0px 100px 0px"
              :total="total"
              :page.sync="queryParams.pageNum"
              :limit.sync="queryParams.pageSize"
              @pagination="getList"
            />
          </div>
        </div>
      </div>
    </el-card>
    <!-- 公告弹窗 -->
    <Dialog
      ref="mychild"
      @AddAnnouncement="AddAnnouncement"
      :uelLocation="uelLocation"
    />
    <!-- 删除 -->
    <el-dialog title="" :visible.sync="deleteDialogVisible" width="30%" center>
      <span>需要注意的是内容是默认不居中的</span>
      <span slot="footer" class="dialog-footer">
        <el-button @click="deleteDialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="centerDialogVisible = false"
          >确 定</el-button
        >
      </span>
    </el-dialog>
  </div>
</template>

<script>
import {
  listAPI,
  editindex,
  moreAPI,
  proUserList,
  Enableforbidden,
} from "@/api/projectManagement/index.js";
import { getIdentityAndTopId } from "@/api/login.js";
import Dialog from "@/views/components/Dialog.vue";
export default {
  data() {
    return {
      deleteDialogVisible: false, //删除弹窗
      uelLocation: "",
      loading: true,
      //启用禁用按钮
      statejudge: false,
      //启用禁用按钮
      EnableforbiddenShow: true,
      // 全的项目列表
      projects: [
        {
          id: "0",
          // icon: '@/assets/img/taobao.svg',
          name: "淘宝",
          sort: "1",
          time: "2021-10-08",
          type: "0",
          status: "1",
        },
      ],
      pickerOptions0: {
        disabledDate(time) {
          return time.getTime() > Date.now() - 8.64e6;
        },
      },

      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 总条数
      total: 0,
      // 角色表格数据
      roleList: [
        // {
        //   proName: 123,
        //   cTime: "2021-09-17",
        // },
        // {
        //   proName: 123,
        //   cTime: "2021-09-17",
        // },
      ],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 是否显示弹出层（数据权限）
      openDataScope: false,
      // 日期范围
      dateRange: [],
      // 状态数据字典
      statusOptions: [
        { dictValue: 1, dictLabel: "启用" },
        { dictValue: 0, dictLabel: "禁用" },
      ],
      // 数据范围选项
      dataScopeOptions: [
        {
          value: "1",
          label: "全部数据权限",
        },
        {
          value: "2",
          label: "自定数据权限",
        },
        {
          value: "3",
          label: "本部门数据权限",
        },
        {
          value: "4",
          label: "本部门及以下数据权限",
        },
        {
          value: "5",
          label: "仅本人数据权限",
        },
      ],
      // 菜单列表
      menuOptions: [],
      // 部门列表
      deptOptions: [],
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        roleName: undefined,
        roleKey: undefined,
        status: undefined,
        dateRange: [],
      },
      // 表单参数
      form: {},
      defaultProps: {
        children: "children",
        label: "label",
      },
      userId: "",
      //租户还是用户
      userName: "",
      datalist: [],
    };
  },
  async created() {},
  async mounted() {
    this.userId = sessionStorage.getItem("userID") - 0;
    //获取是租户还是用户还是平台
    const { data } = await getIdentityAndTopId();
    //console.log(data, "用户信息平台还是租户");
    this.userName = data.identity;
    //公告弹窗
    if (data.identity == "用户") {
      this.AddAnnouncement();
    }
    //          this.queryParams.dateRange[0]=this.moment().format('YYYY')+'-'+this.moment().format('MM')+'-'+"01";
    //  this.queryParams.dateRange[1]=this.moment().format('YYYY-MM-DD');
    this.getList();
  },
  methods: {
    async getList() {
      if (!this.queryParams.dateRange) {
        this.queryParams.dateRange = [];
      }
      let param = {};
      //console.log(this.userName, "888888");
      if (this.userName == "租户") {
        param = {
          pageSize: this.queryParams.pageSize,
          pageNum: this.queryParams.pageNum,
          // userId: this.userId,
          state: this.queryParams.status, //状态
          proName: this.queryParams.roleName, //项目名称
          ccTime: this.queryParams.dateRange[0], //开始时间
          eTime: this.queryParams.dateRange[1], //结束时间
        };
        const data = await listAPI(param);
        //console.log(data, "获取项目列表66666699999");
        if (data.code == 200) {
          this.loading = false;
          if (data.data.list.length > 0) {
            data.data.list.forEach(async (element, index) => {
              // if(element.state){
              //   element.state=true;
              // }else{
              //   element.state=false;
              // }
              element.proLogo = element.proLogo;
              //console.log(element.proLogo, "6677");
              const more = await moreAPI({ projectTypeId: element.typeId });
              if (more.code == 200) {
                //console.log(more.data, "获取更多里面的列表");
                more.data.forEach((item) => {
                  if (item.configKey == "authority") {
                    item.url = require("@/assets/img/qx.png"); //权限
                    item.configName = "权限设置";
                  } else if (item.configKey == "code") {
                    item.url = require("@/assets/img/zylj.png"); //"展业链接"
                  } else if (item.configKey == "original") {
                    item.url = require("@/assets/img/sjmx.png"); //"数据明细"                             //"数据明细"
                  } else if (item.configKey == "summary") {
                    item.url = require("@/assets/img/sjhz.png"); //""数据汇总""                             //"数据明细"
                  }
                });
                element.cTime = more.data;
              }
              // element.cTime.push(
              //     {
              //     configKey: "delete",
              //     configName: "删除",
              //     id:'delete',
              //     isHide: "0",
              //     projectTypeId: ""
              //   },
              // );
              //赋值数组顺序需要显示出来
              element.sort = index + 1;
            });
            this.roleList = data.data.list;
          } else {
            this.roleList = [];
          }
          this.total = data.data.total;
          this.loading = false;
        }
      } else if (this.userName == "用户") {
        this.statejudge = true;
        param = {
          pageSize: this.queryParams.pageSize,
          pageNum: this.queryParams.pageNum,
          // userId: this.userId,
        };
        //console.log(param, "55");
        const userData = await proUserList(param);
        //console.log(userData, "4");
        if (userData.code == 200) {
          if (userData.msg != "项目未绑定用户组") {
            userData.data.list.forEach(async (element) => {
              element.proLogo = element.proLogo;
            });
            this.roleList = userData.data.list;
            this.total = userData.data.total;
          }
          // if (userData.data.list.length > 0) {
          //   userData.data.list.forEach(async (element) => {
          //     const more2 = await moreAPI({ projectTypeId: element.typeId });
          //     if (more2.code == 200) {
          //       // //console.log(more.data, "获取更多里面的列表");
          //       element.cTime = more2.data;
          //     }
          //   });
          // }
        }
        this.loading = false;
      } else {
        this.loading = false;
      }
    },
    //奖励模板
    awardTemplate(row) {
      let config = row.cTime.filter((item) => item.configKey == "vipSummary");
      //console.log(config, "9999");

      this.$router.push({
        path: "ConfigurationAward",
        query: {
          proId: row.proId,
          judgeParam: row.typeId, //脱敏1汇总2
          configTypeId: config[0].id, //会员汇总的id
        },
      });
    },
    //启用禁用按钮
    async EnableforbiddenButton(row) {
      //console.log(this.EnableforbiddenShow, "6666666666666666345345345");
      //console.log(row, "6666666666666666345345345");
      let state2 = 1; //1是启用 0是禁用
      if (row.state) {
        state2 = 0;
      } else {
        state2 = 1;
      }
      let param = {
        proId: row.proId,
        state: state2,
        userId: this.userId,
      };
      const data = await Enableforbidden(param);
      if (data.code == 200) {
        this.$message({
          message: "操作成功!",
          type: "success",
        });
        this.getList();
      } else {
        this.$message.error("操作失败!");
      }
    },
    //码设置按钮
    CodeSettingButton(row) {
      //console.log(row, "码设置");
      this.$router.push({
        path: "CodeSetting",
        query: {
          typeId: row.typeId,
          four: row.four,
          name: row.proName,
          proId: row.proId,
        },
      });
    },
    //公告弹窗
    AddAnnouncement() {
      //传递子组件当前的路由；然后调用子组件的事件函数
      this.uelLocation = window.location.pathname.slice(1);
      this.$refs.mychild.gitData();
    },
    //数据管理按钮
    IdentificationBotton(row) {
      // //console.log(row,'6666')

      this.$router.push({
        path: "tenantIdentification",
        query: {
          typeId: row.typeId,
          four: row.four,
          name: row.proName,
          proId: row.proId,
          judgeParam: row.typeId, //脱敏1汇总2
          proName: row.proName,
        },
      });
    },
    //结算
    settlementBotton(row) {
      this.$router.push({
        path: "BillingDetails",
        query: {
          typeId: row.typeId,
          four: row.four,
          name: row.proName,
          proId: row.proId,
          judgeParam: row.typeId, //脱敏1汇总2
        },
      });
    },
    //佣金模板按钮
    // CommissionButton(row){
    //   //console.log(row)
    //   this.$router.push({
    //       path: "Commission",
    //       query: {
    //         typeId: row.typeId,
    //         four: row.four,
    //         name: row.proName,
    //         proId: row.proId,
    //         judgeParam:row.typeId   //脱敏1汇总2
    //       },
    //     });
    // },
    //删除
    async delData(row) {
      // this.deleteDialogVisible=true;
      this.$confirm("此操作将永久删除该文件, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(async () => {
          let param = {
            delState: 1,
            proId: row.proId,
          };
          const data = await editindex(param);
          if (data.code == 200) {
            this.getList();
            this.$message({
              type: "success",
              message: "删除成功！",
            });
          } else {
            this.$message.error("操作失败！");
          }
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消删除",
          });
        });
      //

      //
    },
    //修改按钮
    editBotton(row) {
      //console.log(row, "修改按钮");
      this.$router.push({
        path: "editindex",
        query: {
          proId: row.proId,
        },
      });
    },

    // 数据按钮
    dataBotton(row) {
      //console.log(row, "数据");
      // if (this.userName == "租户") {
      //   //console.log(row, "数据");
      //   this.$router.push({
      //     path: "tenantData",
      //     query: {
      //       proId: row.proId,
      //     },
      //   });
      // } else if (this.userName == "用户") {
      //   this.$router.push("userData");
      // }

      this.$router.push({
        path: "tenantData",
        query: {
          proId: row.proId,
          judgeParam: row.typeId,
        },
      });
    },
    //权限按钮
    jurisdiction(row, typerow) {
      //console.log(row, "数组数据");
      //console.log(typerow, "项目数据");
      // 先把名称保存到本地，然后跳转路由到页面后，把本地保存的名称显示出来
      sessionStorage.setItem("configName", row.configName);

      let param = {
        fullPath: "/projectManagement/projectlist",
        hash: "",
        name: "Projectlist",
        path: "/projectManagement/projectlist",
        title: "项目列表",
      };
      // 但是名称显示会有缓存问题，所以在跳转之前关闭掉其它路由后再进行跳转。
      this.$router.push(param).catch(() => {});
      this.$store.dispatch("tagsView/delOthersViews", param).then(() => {
        this.moveToCurrentTag();
      });

      switch (row.id) {
        // case "editindex": //修改
        //   this.$router.push({
        //     path: "editindex",
        //     query: {
        //       proId: typerow.proId,
        //     },
        //   });
        //   break;
        //  case 'SettlementAward':    //结算奖励
        // this.$router.push({
        //   path: "SettlementAward",
        //   query: { },
        // });
        // break;
        case 1:
          this.$router.push({
            path: "jurisdiction",
            query: { proId: typerow.proId, proName: typerow.proName },
          });
          break;
        case 8:
          this.$router.push({
            path: "jurisdiction",
            query: { proId: typerow.proId, proName: typerow.proName },
          });
          break;
        default:
          this.$router.push({
            path: "CodeSetting",
            query: {
              typeId: row.id,
              four: typerow.four,
              name: typerow.proName,
              proId: typerow.proId,
              judgeParam: typerow.typeId, //分辨是汇总还是脱敏   汇总是2 脱敏是1
            },
          });
          break;
      }
    },
    // 结算设置按钮
    settlementSetupButton(row) {
      //console.log(row, "555");
      //筛选出会员汇总的id
      const config = row.cTime.filter((item) => item.configKey == "vipSummary");
      this.$router.push({
        path: "settlementSetup",
        query: {
          typeId: row.typeId,
          four: row.four,
          name: row.proName,
          proId: row.proId,
          judgeParam: row.typeId, //脱敏1汇总2
          configTypeId: config[0].id, //会员汇总的id
        },
      });
    },

    //重置
    resetQuery() {
      this.queryParams = {
        pageNum: 1,
        pageSize: 10,
        roleName: undefined,
        roleKey: undefined,
        status: undefined,
      };
      //        this.queryParams.dateRange[0]=this.moment().format('YYYY')+'-'+this.moment().format('MM')+'-'+"01";
      //  this.queryParams.dateRange[1]=this.moment().format('YYYY-MM-DD');
      this.getList();
    },
    handleAdd() {
      this.$router.push("addItem1");
    },
  },
  components: { Dialog },
};
</script>
<style scoped lang="scss">
.topBoxCard {
  font-size: 14px;
  // border: 1px red solid;
  display: flex;

  justify-content: space-between;
  align-items: center;
  // color: #3875f6;
  // border: 1px red solid;
  .LeftBox {
    // border: 1px red solid;
    width: 50%;
    height: 35px;
    display: flex;
    align-items: center;
    .imgBox {
      //  border: 1px red solid;
      display: flex;
      align-items: center;
      height: 100%;
    }
  }
  .rightBox {
    // border: 1px red solid;
    width: 50%;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
  }
}
.project-button {
  // color: #3874f6;
  // font-size: 13px;
  // border: 1px red solid;
  display: flex;
  flex-wrap: wrap;
  margin: 15px 0px;
  // padding: 10px 0px 20px 0px;
  .topBox {
    //  border: 1px red solid;
    display: flex;
    width: 100%;
    .buttonBox {
      width: 25%;
      // border: 1px red solid;
      display: flex;
      // justify-content: center;
      justify-content: flex-start;
      align-items: center;
    }
  }
}

/* 用户状态下的卡片 */
.EnterBox {
  color: #ffffff;
  font-size: 12px;
  text-align: right;
  height: 90%;
  width: 60px;
  font-weight: 400;
  border-radius: 10px;
  background: rgb(24, 144, 255);
  display: flex;
  align-items: center;
  justify-content: center;
}
.messageBox {
  font-size: 13px;
  display: flex;
  flex-wrap: wrap;
  padding: 10px 0px 10px 0px;
  // background: red;
  // border: 1px red solid;
  // width: 100%;
  // height: 30px;
}
.cardBox {
  height: 300px;
  width: 380px;
  margin-bottom: 15px;
  border-radius: 10px;
  /* background: item.state == 1 ? '#FFFFFF' : '#f5f5f5', */
  background: #ffffff;
  margin-left: 26px;
}
.cardBox2 {
  height: 300px;
  width: 380px;
  margin-bottom: 15px;
  border-radius: 10px;
  /* background: item.state == 1 ? '#FFFFFF' : '#f5f5f5', */
  background: #f5f5f5;
  margin-left: 26px;
}

.xhxBox {
  border-top: 1px #eee solid;
  height: 5px;
  border: 1px red solid;
}
</style>
<style>
.el-select-dropdown .el-scrollbar .el-scrollbar__wrap {
  overflow: scroll !important;
}
.project-list .el-date-editor .el-range-separator {
  width: 15%;
}

.project-list .el-form-item--medium .el-form-item__content {
  width: 200px;
}

.project-list .status-switch {
  line-height: 1;
  font-size: 14px;
  display: inline-block;
  font-weight: 500;
  cursor: pointer;
  margin-left: 5px;
}

.project-list .project-button img {
  margin-right: 3px;
}

.project-list .project-button img:last-child {
  margin-left: 3px;
}

.project-list {
  display: flex;
  align-items: center;
  margin-right: 20px;
  margin-top: 20px;
}

.project-list .el-dropdown-menu__item {
  font-size: 14px;
}

.el-dropdown-menu__item:not(.is-disabled):hover {
  background-color: #f5f5f5 !important;
  color: #5c8af6 !important;
}

.project-list .el-divider--horizontal {
  background: #f0f0f0;
}

.project-list .el-card__header {
  margin: 0 20px;
  padding-left: 0px;
  border-bottom: 1px #eee solid;
}

/*.project-list .el-card__body {*/
/*  padding: 0;*/
/*}*/
</style>
